package com.rainng.coursesystem.controller.teacher;

import com.rainng.coursesystem.model.vo.response.ResultVO;
import com.rainng.coursesystem.service.teacher.TeacherStudentCourseService;
import org.springframework.web.bind.annotation.*;

@RestController("teacherStudentCourseController")
@RequestMapping("/teacher/student-course")
public class TeacherStudentCourseController {
    private final TeacherStudentCourseService service;

    public TeacherStudentCourseController(TeacherStudentCourseService service) {
        this.service = service;
    }

    @GetMapping("/page")
    public ResultVO getPage(@RequestParam Integer index, @RequestParam(required = false) String studentName,
                           @RequestParam(required = false) String courseName, @RequestParam(required = false) Integer status) {
        return service.getPage(index, studentName, courseName, status);
    }

    @PostMapping("/audit")
    public ResultVO audit(@RequestParam Integer id, @RequestParam Boolean type) {
        return service.audit(id, type);
    }
} 